#ifndef _BUILDER_H_
#define _BUILDER_H_

#include <iostream>
#include <string>
#include <list>

using namespace std;

class Product
{
public:
	void AddPart(const string& part);
	void Show() const;
private:
	list<string> _parts;	
};

class IBuilder
{
public:
	virtual void AddPartA() = 0;
	virtual void AddPartB() = 0;
	virtual void AddPartC() = 0;
	virtual Product* GetProduct() = 0;
};

class ConcreteBuilderA:public IBuilder
{
public:
	ConcreteBuilderA();
	virtual void AddPartA();
	virtual void AddPartB();
	virtual void AddPartC();
	virtual Product* GetProduct();
private:
	Product* _product;
};

class ConcreteBuilderB:public IBuilder
{
public:
	ConcreteBuilderB();
	virtual void AddPartA();
	virtual void AddPartB();
	virtual void AddPartC();
	virtual Product* GetProduct();
private:
	Product* _product;
};

class Director
{
public:
	void Construct(IBuilder* builder);
private:
	IBuilder* _builder;
};

#endif
